Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mask sensitive values in /config proxy debug server endpoint #4086

Merged
merged 1 commit into from
Jul 4, 2022
Merged

mask sensitive values in /config proxy debug server endpoint #4086

merged 1 commit into from
Jul 4, 2022

Conversation

wkloucek
Copy link
Contributor

@wkloucek wkloucek commented Jul 4, 2022

Description

curl localhost:9205/config | jq . returns some secrets prior this PR. Now it returns:

{
  "Commons": {
    "Log": {
      "Level": "",
      "Pretty": false,
      "Color": false,
      "File": ""
    },
    "Tracing": {
      "Enabled": false,
      "Type": "",
      "Endpoint": "",
      "Collector": ""
    },
    "OcisURL": "",
    "TokenManager": {
      "JWTSecret": "************"
    },
    "Reva": null,
    "MachineAuthAPIKey": "************",
    "TransferSecret": "************",
    "SystemUserID": "09fd4b5e-6fa8-4d56-9f51-10a91a1f0c04",
    "SystemUserAPIKey": "************",
    "AdminUserID": "af02240f-de66-4f30-a574-00bb8f3ad69b"
  },
  "Service": {
    "Name": "proxy"
  },
  "Tracing": {
    "Enabled": false,
    "Type": "",
    "Endpoint": "",
    "Collector": ""
  },
  "Log": {
    "Level": "",
    "Pretty": false,
    "Color": false,
    "File": ""
  },
  "Debug": {
    "Addr": "127.0.0.1:9205",
    "Token": "",
    "Pprof": false,
    "Zpages": false
  },
  "HTTP": {
    "Addr": "0.0.0.0:9200",
    "Root": "/",
    "Namespace": "com.owncloud.web",
    "TLSCert": "/home/kloucek/.ocis/proxy/server.crt",
    "TLSKey": "/home/kloucek/.ocis/proxy/server.key",
    "TLS": true
  },
  "Reva": {
    "Address": "127.0.0.1:9142"
  },
  "Policies": [
    {
      "Name": "ocis",
      "Routes": [
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/",
          "Backend": "http://localhost:9100",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/.well-known/",
          "Backend": "http://localhost:9130",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/konnect/",
          "Backend": "http://localhost:9130",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/signin/",
          "Backend": "http://localhost:9130",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/archiver",
          "Backend": "http://localhost:9140",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "regex",
          "Method": "",
          "Endpoint": "/ocs/v[12].php/cloud/user/signing-key",
          "Backend": "http://localhost:9110",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/ocs/",
          "Backend": "http://localhost:9140",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "query",
          "Method": "",
          "Endpoint": "/remote.php/?preview=1",
          "Backend": "http://localhost:9115",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "REPORT",
          "Endpoint": "/remote.php/dav/",
          "Backend": "http://localhost:9115",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "query",
          "Method": "",
          "Endpoint": "/dav/?preview=1",
          "Backend": "http://localhost:9115",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "query",
          "Method": "",
          "Endpoint": "/webdav/?preview=1",
          "Backend": "http://localhost:9115",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/remote.php/",
          "Backend": "",
          "Service": "com.owncloud.web.ocdav",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/dav/",
          "Backend": "",
          "Service": "com.owncloud.web.ocdav",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/webdav/",
          "Backend": "",
          "Service": "com.owncloud.web.ocdav",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/status",
          "Backend": "",
          "Service": "com.owncloud.web.ocdav",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/status.php",
          "Backend": "",
          "Service": "com.owncloud.web.ocdav",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/index.php/",
          "Backend": "",
          "Service": "com.owncloud.web.ocdav",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/apps/",
          "Backend": "",
          "Service": "com.owncloud.web.ocdav",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/data",
          "Backend": "http://localhost:9140",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/app/",
          "Backend": "http://localhost:9140",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/graph/",
          "Backend": "http://localhost:9120",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/graph-explorer",
          "Backend": "http://localhost:9135",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/api/v0/settings",
          "Backend": "http://localhost:9190",
          "Service": "",
          "ApacheVHost": false
        },
        {
          "Type": "",
          "Method": "",
          "Endpoint": "/settings.js",
          "Backend": "http://localhost:9190",
          "Service": "",
          "ApacheVHost": false
        }
      ]
    }
  ],
  "OIDC": {
    "Issuer": "https://localhost:9200",
    "Insecure": true,
    "UserinfoCache": {
      "Size": 1024,
      "TTL": 10
    }
  },
  "TokenManager": {
    "JWTSecret": "************"
  },
  "PolicySelector": {
    "Static": {
      "Policy": "ocis"
    },
    "Claims": null,
    "Regex": null
  },
  "PreSignedURL": {
    "AllowedHTTPMethods": [
      "GET"
    ],
    "Enabled": true
  },
  "AccountBackend": "cs3",
  "UserOIDCClaim": "email",
  "UserCS3Claim": "mail",
  "MachineAuthAPIKey": "************",
  "AutoprovisionAccounts": false,
  "EnableBasicAuth": false,
  "InsecureBackends": true,
  "AuthMiddleware": {
    "CredentialsByUserAgent": null
  }

Related Issue

Motivation and Context

How Has This Been Tested?

  • curl command above

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@wkloucek wkloucek requested review from C0rby and rhafer July 4, 2022 09:41
@sonarcloud
Copy link

sonarcloud bot commented Jul 4, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@wkloucek wkloucek merged commit e41975b into owncloud:master Jul 4, 2022
@wkloucek wkloucek deleted the mask-proxy-config-endpoint branch July 4, 2022 18:57
ownclouders pushed a commit that referenced this pull request Jul 4, 2022
Merge: 6c7ca9e 627c79d
Author: Willy Kloucek <34452982+wkloucek@users.noreply.github.com>
Date:   Mon Jul 4 20:57:26 2022 +0200

    Merge pull request #4086 from wkloucek/mask-proxy-config-endpoint

    mask sensitive values in /config proxy debug server endpoint
@micbar micbar mentioned this pull request Jul 19, 2022
36 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/config endpoints leak secrets
2 participants